////
////  MGCLoginRegisterViewController.m
////  IOS-Screen
////
////  Created by alex.chih on 16/4/23.
////  Copyright © 2016年 alex.chih. All rights reserved.
////
//#import "PrefixHeader.pch"
//
//#import "KeychainItemWrapper.h"
//#import "MGCUSers.h"
//#import "MGCValidate.h"
//#import "MGCTabBarController.h"
//#import "EncryptUtil.h"
//#import "MGCSettingDone.h"
//#import "MGCHomeDefine.h"
//
//#import "MGCThreePortButton.h"
//
//#import "LoginThirdpartyKeys.h"
//
//#import "WXApi.h"
//#import "WechatEntity.h"
//#import "QQEntity.h"
//#import "ThirdBaseEntity.h"
//
//#import "ThirdPartWeibo.h"
//#import "SeWeiboEntity.h"
//
//#import <TencentOpenAPI/TencentOAuth.h>
//
//#import <CommonCrypto/CommonDigest.h>
//#import <MJExtension.h>
//#import <AFNetworking.h>
//#import <MBProgressHUD.h>
//
//#import "SeAlertView.h"
//
//#import "ThirdDefine.h"
//#import "ThirdPartQQ.h"
//
//#import "OverRun-Swift.h"
//
//
///** 标识 */
//@property (nonatomic, assign) BOOL *regInfo;
//
////@property (nonatomic, strong) ThirdPartQQ *partQQ;
//
//@end
//
//@implementation LoginPass
//
//-(void)setupThirdpartView
//{
//    if (![WXApi isWXAppInstalled])
//    {
//        self.bt_wechat.hidden = YES;
//    }
//    
////    if (![TencentOAuth iphoneQQInstalled])
////    {
////        self.bt_qq.hidden = YES;
////    }
////    else
//    {
//        UITapGestureRecognizer* tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(qqLoginClick:)];
//        [self.bt_qq addGestureRecognizer:tapGesture];
//    }
//    
////    if (![ThirdPartWeibo checkWB])
////    {
////        self.bt_weibo.hidden = YES;
////    }
////    else
//    {
//        UITapGestureRecognizer* tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(weiboLoginClick:)];
//        [self.bt_weibo addGestureRecognizer:tapGesture];
//    }
//
//    if(self.bt_weibo.hidden && self.bt_qq.hidden && self.bt_wechat.hidden)
//    {
////        self.lb_thirdHint.hidden = YES;
//    }
//}
//
//#pragma mark - QQ登录 点击事件
//- (void)qqLoginClick:(id)sender
//{
//    [CommonShare setController:self];
//    [ThirdPartQQ login];
//}
//
//#pragma mark - 微博登录
//- (void)weiboLoginClick:(id)sender
//{
//    [CommonShare setController:self];
//    [ThirdPartWeibo authorizeWB];
//}
//
//#pragma mark - 微信登录
//- (IBAction)wechatLoginClick:(id)sender
//{
//    [CommonShare setController:self];
//    [self wechatLogin];
//}
//
//- (void)wechatLogin
//{
//    SendAuthReq *req = [[SendAuthReq alloc] init];
//    req.scope = @"snsapi_userinfo";
//    req.state = kAppDescription;
//    [WXApi sendReq:req];
//}
//
////通用登录操作
//+(BOOL)genericLoginProcess:(id)entity
//{
//    static BOOL result = YES;
//    
//    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    
//    //NSString* tmp = @"http://192.168.3.107:8080/mobile/main/user/outerLogin";
//    //NSString *url = tmp;//第三方/登录请求链接
//    NSString *url = MGCDefaultLoginUrl;//第三/方登录请求链接
//    
//    ThirdBaseEntity *base;
//    
////    NSString * aClassName = @"SunnyClass";
////    Class class = NSClassFromString(aClassName);
////    id instance = [[class alloc] init];
//    
//    if([entity isKindOfClass:[ThirdBaseEntity class]])
//    {
//        [params setObject:[(ThirdBaseEntity*)entity userId] forKey:@"unionid"];
//        [params setObject:[(ThirdBaseEntity*)entity headimgurl] forKey:@"headimgurl"];
//    }
//    
//    if([entity isKindOfClass:[WechatEntity class]] || [entity isKindOfClass:[QQEntity class]] || [entity isKindOfClass:[SeWeiboEntity class]])
//    {
//        
//    }
//    
//    if ([entity isKindOfClass:[WechatEntity class]])
//    {
//        base = (WechatEntity*)entity;
//        [MGCSettingDone setThirdUserState:wechatUser];
////        [params setObject:[(WechatEntity*)base unionid] forKey:@"unionid"];
////        [params setObject:[(WechatEntity*)base headimgurl] forKey:@"headimgurl"];
//    }
//    else if ([entity isKindOfClass:[QQEntity class]])
//    {
//        base = (QQEntity*)entity;
//        [MGCSettingDone setThirdUserState:qqUser];
////        [params setObject:[(QQEntity*)base openId] forKey:@"unionid"];
////        [params setObject:[(QQEntity*)base figureurl_qq_1] forKey:@"headimgurl"];
//    }
//    else if([entity isKindOfClass:[SeWeiboEntity class]])
//    {
//        base = (SeWeiboEntity*)entity;
//        [MGCSettingDone setThirdUserState:weiboUser];
//    }
//    else
//    {
//        url = MGCLoginURL;//网站会员登录请求链接
//        [MGCSettingDone setThirdUserState:localUser];
//        
//        //正常登录时会有值
//        [params setObject:base.username forKey:@"loginName"];
//        [params setObject:base.password forKey:@"password"];
//    }
//    
//    {
////        [params setObject:base.nickname forKey:@"loginName"];
////        [params setObject:base.nickname forKey:@"userName"];
//        [params setObject:!base.nickname?@"":base.nickname forKey:@"nickname"];
//        [params setObject:!base.province?@"":base.province forKey:@"province"];
//        [params setObject:!base.country?@"":base.country forKey:@"country"];
//        [params setObject:!base.city?@"":base.city forKey:@"city"];
//        [params setObject:!base.sex?@"":base.sex forKey:@"sex"];
//        [params setObject:!base.type?@"wechat":base.type forKey:@"type"];
//    }
//    
//    NSLog(@"参数准备: %@",params);
//    
//    //发送请求
//    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
////    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//    [manager POST:[NaFilter requestDicWithUrl:url par:params] parameters:params progress:nil success:^(NSURLSessionTask *task, id responseObject)
//    {
//        NSLog(@"请求用户信息的response = %@", responseObject);
//        NSDictionary *dic = [NSDictionary dictionaryWithDictionary:responseObject];
//        NSString *status = dic[@"status"];
//        
//        if([status isEqualToString:@"true"])
//        {
//            KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
//            //[keychain setObject:dic[@"userId"] forKey:(id)kSecAttrSubjectKeyID];
//            [MGCSettingDone setUserId:dic[@"userId"]];
//            
//            //[keychain setObject:dic[@"userName"] forKey:(__bridge id)(kSecAttrLabel)];
//            [keychain setObject:base.nickname forKey:(__bridge id)(kSecAttrLabel)];
//            
//            NSMutableDictionary *tmp = [NSMutableDictionary dictionaryWithDictionary:responseObject];
//            
////            if ([entity isKindOfClass:[WechatEntity class]])
////                [tmp setObject:[(WechatEntity*)base headimgurl] forKey:@"picMinPath"];
////            else if ([entity isKindOfClass:[QQEntity class]])
////                [tmp setObject:[(QQEntity*)base figureurl_qq_2] forKey:@"picMinPath"];
//            
//            if([entity isKindOfClass:[ThirdBaseEntity class]])
//                [tmp setObject:[(ThirdBaseEntity*)base headimgurl] forKey:@"picMinPath"];
//            
//            [tmp writeToFile:MGCUserPath atomically:YES];
//            
//            result = YES;
//            
//            [MGCSettingDone setVipEndTime:dic[@"vipEndTime"]];
//            
//            //[hud hideAnimated:YES];
//            //[self dismissViewControllerAnimated:YES completion:nil];
//            
////            [self dismissViewControllerAnimated:YES completion:nil];
//            
//            [CommonShare.controller dismissViewControllerAnimated:YES completion:nil];
//        }
//        else
//        {
//            [SeAlertView show:NSLocalizedString(@"error",@"") message:NSLocalizedString(@"thirdLoginFailed",@"") duration:1.2];
//            
//            KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
//            [keychain resetKeychainItem];
//            
//            result = NO;
//        }
//    }
//    failure:^(NSURLSessionTask *operation, NSError *error)
//    {
//        [SeAlertView show:NSLocalizedString(@"error",@"") message:NSLocalizedString(@"thirdLoginFailed",@"") duration:1.2];
//        
//        //请求失败后内容
//        NSLog(@"获取用户信息时出错 = %@", error);
//    }];
//    
//    return result;
//}
//
////点击忘记密码提交
//- (IBAction)forGetPassword:(id)sender
//{
//    NSString *foremail = self.forEmail.text;// 获取输入的用户名
//    
//    if (![foremail isEqualToString:@""]) {// 非空则保存
//        MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//        hud.label.text = NSLocalizedString(@"submiting",@"");
//        
//        //发送请求
//        AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//        //manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//        manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//        
//        NSMutableDictionary *params = [NSMutableDictionary dictionary];
//        params[@"email"] = foremail;
//        
//        [manager POST:MGCRegisterValid parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
//            
//            MGCValidate *result = [MGCValidate mj_objectWithKeyValues:responseObject];
//            
//            if (![result.status isEqualToString:@"true"])
//            {
//                
//                [hud hideAnimated:YES];
//                //发送请求
//                AFHTTPSessionManager *managers = [AFHTTPSessionManager manager];
//                //manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//                managers.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//                
//                [managers GET:MGCForgetPassword parameters:params progress:nil success:^(NSURLSessionTask *task, id responseObject) {
//                    // 延迟2秒后消失
//                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"mailSent",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//                    [alert show];
//                } failure:^(NSURLSessionTask *operation, NSError *error) {
//                    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"mailSent",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//                    [alert show];
//                }];
//            }else{
//                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"whoIAM",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//                // 显现
//                [alert show];
//                [hud hideAnimated:YES];
//            }
//            
//        } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
//            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"dataAccessFailed",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//            [alert show];
//            [hud hideAnimated:YES];
//        }];
//    }else{
//        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"heEmail",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//        // 显现
//        [alert show];
//    }
//}
//
////点击提交注册按钮
//- (IBAction)submitRegister:(id)sender
//{
//    MGCLogFunc;
//    NSString *loginName = self.regLoginname.text;// 获取输入的用户名
//    NSString *password = self.regPassword.text;// 获取输入的用户名
//    NSString *email = self.regemail.text;// 获取输入的用户名
//    NSString *username = self.regUsername.text;// 获取输入的用户名
//    NSString *mobile = self.regPhone.text;// 获取输入的用户名
//    
//    //NSString* tmp = @"http://192.168.3.135:8080/mobile/main/user/regist";//MGCRegister
//    //NSString* tmp = @"http://192.168.3.117:8088/mobile/main/user/regist";//MGCRegister
//    
////    if (self.regInfo) {
//        
//    //发送请求
//    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//    //manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//    
//    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    params[@"loginName"] = loginName;
//    params[@"password"] = password;
//    params[@"email"] = email;
//    params[@"username"] = username;
//    params[@"mobile"] = mobile;
//    
//    MGCLog(@"%@",params);
//    
//    if ([loginName isEqualToString:@""] || [password isEqualToString:@""]) {
//        [self showMessage:NSLocalizedString(@"apMust",@"")];
//    } else {
//        if (![_regPhone.text isEqualToString:@""]) {
//            if (![self checkPhoneNumInput:_regPhone.text]) {
//                [self showMessage:NSLocalizedString(@"wrongmobile",@"")];
//                return;
//            }
//        }
//        if (![_regemail.text isEqualToString:@""]){
//            if (![self isValidateEmail:_regemail.text] ) {
//                [self showMessage:NSLocalizedString(@"wrongemail",@"")];
//                return;
//            }
//        }
//        MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//        hud.label.text = NSLocalizedString(@"submiting",@"");
//        
//        [manager POST:[NaFilter requestDicWithUrl:MGCRegister par:params] parameters:params progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject)
//        {
//            MGCValidate *result = [MGCValidate mj_objectWithKeyValues:responseObject];
//            MGCLog(@"%@",responseObject);
//            if (![result.status isEqualToString:@"false"])
//            {
//                [hud hideAnimated:YES];
//                
//                KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
//                
//                [keychain setObject:MGCAPPCREDENTIALS forKey:(id)kSecAttrService];
//                [keychain setObject:loginName forKey:(__bridge id)(kSecAttrAccount)];
//                [keychain setObject:username forKey:(__bridge id)(kSecAttrLabel)];
//                [keychain setObject:password forKey:(__bridge id)(kSecValueData)];
//                
//                [responseObject writeToFile:MGCUserPath atomically:YES];
//                
//                MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//                hud.label.text = NSLocalizedString(@"registerSucceed",@"");
//                
////                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
////                    UIApplication.sharedApplication.delegate.window.rootViewController = [[MGCTabBarController alloc] init];
////                });
//                
//                [MGCSettingDone setUserId:[responseObject valueForKey:@"userId"]];
//                
//                [self dismissViewControllerAnimated:YES completion:nil];
//            }
//            else
//            {
//                [hud hideAnimated:YES];
//                
//                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:result.message delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//                // 显现
//                [alert show];
//            }
//            
//        }
//        failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error)
//        {
//            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"dataAccessFailed",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//            [alert show];
//            [hud hideAnimated:YES];
//        }];
//    }
//}
//
///* 自动登录
//**
//** 1.检测是否有默认值，如果有就获取，否者终止自动登录。(Check if have default value,if we have then get the value,if not then stop auto login)
//** 2.如果有网络，使用获取到的用户名密码进行登陆操作。否则直接进入主界面(Use the value we already got to perform login process)
//** 3.若登陆成功则更新本地信息，然后跳转至主界面。若登陆失败则删除密码等信息，弹出提示框，并终止自动登陆。(if login succeed then update local date and jump to main page.if failed then delete user date like password etc,and popup alert window then stop auto login)
//*/
//-(BOOL)autoLogin
//{
//    //return NO;
//    KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];// 通过同样的标志创建keychain
//    // 获取对应Key里保存的用户名和密码
//    NSString *username = [keychain objectForKey:(__bridge id)(kSecAttrAccount)];
//    NSString *password = [keychain objectForKey:(__bridge id)(kSecValueData)];
//    
//    if(username == nil || password == nil || [username isEqualToString:@""] || [password isEqualToString:@""])
//        return NO;
//    
//    //网络不给力~~~
//    if([MGCSettingDone checkNetworkStatus] == NoNetwork)
//        return YES;
//    
//    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//    hud.label.text = NSLocalizedString(@"loading",@"");
//        
//    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    params[@"loginName"] = username;
//    params[@"password"] = password;
//        
//    //发送请求
//    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//    //manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//    
//    [manager GET:MGCLoginURL parameters:params progress:nil success:^(NSURLSessionTask *task, id responseObject)
//    {
//        self.Users = [MGCUsers mj_objectWithKeyValues:responseObject];
//        
//        if ([self.Users.status isEqualToString:@"true"])
//        {
//            KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
//            //                [keychain setObject:MGCAPPID forKey:(id)kSecAttrAccessGroup];
//            [MGCSettingDone setUserId:self.Users.userId];
//            [keychain setObject:MGCAPPCREDENTIALS forKey:(id)kSecAttrSubjectKeyID];
//            [keychain setObject:username forKey:(__bridge id)(kSecAttrAccount)];
//            [keychain setObject:password forKey:(__bridge id)(kSecValueData)];
//            
//            [responseObject writeToFile:MGCUserPath atomically:YES];
//            
//            UIApplication.sharedApplication.delegate.window.rootViewController = [[MGCTabBarController alloc] init];
//            
//            [hud hideAnimated:YES];
//        }
//        else
//        { 
//            [hud hideAnimated:YES];
//            
//            KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
//            [keychain resetKeychainItem];
//            
//            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"areUSure",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//            [alert show];
//        }
//        
//    }
//    failure:^(NSURLSessionTask *operation, NSError *error)
//    {
//        [hud hideAnimated:YES];
//        
//        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"autoSignFailed",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//        [alert show];
//    }];
//    
//    if(self.Users != nil && [self.Users.status isEqualToString:@"true"])
//        return YES;
//    else
//        return NO;
//}
//
////点击登录按钮执行操作
//- (IBAction)LoginPage:(id)sender
//{
//    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//    hud.label.text = NSLocalizedString(@"loading",@"");
//    
//    //NSString* tmp = @"http://192.168.3.117:8088/mobile/main/user/login";//MGCLoginURL
//    
//    NSString *username = self.usernameField.text;// 获取输入的用户名
//    NSString *password = self.passwordField.text;// 获取输入的密码
//    if (![username isEqualToString:@""] && ![password isEqualToString:@""])
//    {
//        // 非空则保存
//        NSMutableDictionary *params = [NSMutableDictionary dictionary];
//        params[@"loginName"] = username;
//        params[@"password"] = password;
//        
//        //发送请求
//        AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
//        //manager.responseSerializer = [AFHTTPResponseSerializer serializer];
//        manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
//        
//        [manager GET:[NaFilter requestDicWithUrl:MGCLoginURL par:params] parameters:params progress:nil success:^(NSURLSessionTask *task, id responseObject)
//        {
//            NSLog(@"请求用户信息的response = %@", responseObject);
//            self.Users = [MGCUsers mj_objectWithKeyValues:responseObject];
//            
//            if ([self.Users.status isEqualToString:@"true"])
//            {
//                KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"Login" accessGroup:nil];
////                [keychain setObject:MGCAPPID forKey:(id)kSecAttrAccessGroup];
//                [keychain setObject:MGCAPPCREDENTIALS forKey:(id)kSecAttrService];
////                [keychain setObject:self.Users.userId forKey:(id)kSecAttrIsNegative];
//                
//                [keychain setObject:self.Users.userName forKey:(__bridge id)(kSecAttrLabel)];
//                [keychain setObject:username forKey:(__bridge id)(kSecAttrAccount)];
//                [keychain setObject:password forKey:(__bridge id)(kSecValueData)];
//                
//                [responseObject writeToFile:MGCUserPath atomically:YES];
//                
//                //setup xxxxxxxxxxx
//                
//                [MGCSettingDone setUserId:self.Users.userId];
//                [MGCSettingDone setThirdUserState:localUser];
//                [MGCSettingDone setVipEndTime:self.Users.vipEndTime];
//                
//                [hud hideAnimated:YES];
//            
//                [self dismissViewControllerAnimated:YES completion:nil];
//                
//                //UIApplication.sharedApplication.delegate.window.rootViewController = [[MGCTabBarController alloc] init];
//                //[self.navigationController popViewControllerAnimated:YES];
//            }
//            else
//            {
//                [hud hideAnimated:YES];
//                // 延迟2秒后消失
//                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"areUSure",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//                [alert show];
////                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
////                    [SVProgressHUD dismiss];
////                });
//            }
//            
//        } failure:^(NSURLSessionTask *operation, NSError *error) {
//            
//            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"dataAccessFailed",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//            [alert show];
//            
//            [hud hideAnimated:YES];
//
//        }];
//        
//    }else{
//        [hud hideAnimated:YES];
//        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"prompt",@"") message:NSLocalizedString(@"apMust",@"") delegate:self cancelButtonTitle:NSLocalizedString(@"ok",@"") otherButtonTitles:nil, nil];
//        // 显现
//        [alert show];
//    }
//}
//
////注册按钮动画操作
//- (IBAction)Register:(id)sender
//{
//    self.LoginViewLeftMargin.constant =- self.view.ac_width + 50;
//    self.threePartLeftMargin.constant =- self.view.ac_width;
//    [UIView animateWithDuration:0.25 animations:^{
//        [self.view layoutIfNeeded];
//    }];
//}
//
////忘记密码动画操作
//- (IBAction)forgetPassword:(id)sender
//{
//    self.LoginViewLeftMargin.constant =+ self.view.ac_width + 50;
//    self.threePartLeftMargin.constant =+ self.view.ac_width;
//    [UIView animateWithDuration:0.25 animations:^{
//        [self.view layoutIfNeeded];
//    }];
//}
//
////动画返回
//- (IBAction)registerBack:(id)sender
//{
//    self.LoginViewLeftMargin.constant = 50;
//    self.threePartLeftMargin.constant = 0;
//    [UIView animateWithDuration:0.25 animations:^{
//        [self.view layoutIfNeeded];
//    }];
//}
//
//@end
